import { request } from '../request.js';

// 登录api
function login (data) {
  return request({
    url: '/sys/login',
    // url: '/api/handheld/login',
    method: 'post',
    data
  })
}
// 退出登录
function logout (data) {
  return request({
    url: '/sys/logout',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data
  })
}
// 获取验证码接口
function getCaptcha () {
  return request({
    url: '/getCaptcha',
    // url: '/api/handheld/getCaptcha',
    responseType:'arraybuffer',
    method: 'get'
  })
}
// 获取用户数据
function getUserInfo () {
  return request({
    url: '/sys/userInfo',
    method: 'get'
  })
}
//
function remoteAuth (data) {
  return request({
    url: '/sys/remoteAuth',
    // url: '/api/handheld/login',
    method: 'post',
    data
  })
}
// 手机验证
function mobileCheck (parameter) {
  return request({
    url: '/sys/mobileCheck',
    method: 'post',
    data: parameter
  })
}
export default {
  login,logout,getCaptcha,getUserInfo,remoteAuth,
  mobileCheck
}
